< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03090403.xhp

(section: declare) (bookmark: bm_id3148473)
Declare statement

Declare ステートメント

Declare Statement [Runtime]
Declare ステートメント [実行時](hd_id3148473.1)

(bookmark: bm_id3145316)
DLL (Dynamic Link Library)

DLL (Dynamic Link Library)

Declares and defines a subroutine in a DLL file that you want to execute from Office Basic.
Office Basic から実行する DLL ファイル内のサブルーチンの宣言と定義を行います。(par_id3145316.2)

(/section: declare)

See also: FreeLibrary
次も参照してください:FreeLibrary(par_id3146795.3)

Syntax:
構文:(hd_id3156344.4)

Declare {Sub | Function} Name Lib "Libname" [Alias "Aliasname"] [Parameter] [As Type]
Declare {Sub | Function} Name Lib "Libname" [Alias "Aliasname"] [Parameter] [As Type](par_id3148664.5)

Parameters:
パラメータ:(hd_id3153360.6)

Name: A different name than defined in the DLL, to call the subroutine from Office Basic.
Name: Office Basic からサブルーチンを呼び出すための DLL 内の定義名とは異なる名前。(par_id3154140.8)

Aliasname: Name of the subroutine as defined in the DLL.
Aliasname:サブルーチンの DLL 内の定義名。(par_id3150870.9)

Libname: File or system name of the DLL. This library is automatically loaded the first time the function is used.
Libname: DLL のファイルないしシステム名このライブラリは、関数の初回使用時に自動的に読み込まれます。(par_id3154684.10)

Argumentlist: List of parameters representing arguments that are passed to the procedure when it is called. The type and number of parameters is dependent on the executed procedure.
Argumentlist: 呼び出し時にプロシージャーに渡される引数を示すパラメータのリストパラメータの種類と数は、実行するプロシージャーに依存します。(par_id3148452.11)

Type: Defines the data type of the value that is returned by a function procedure. You can exclude this parameter if a type-declaration character is entered after the name.
Type: 関数プロシージャーにより返される値のデータ型を指定します。名前の次に型宣言子を入力する場合、このパラメータは省略できます。(par_id3147289.12)

Warning Icon 警告マーク To pass a parameter to a subroutine as a value instead of as a reference, the parameter must be indicated by the keyword ByVal.
パラメータをサブルーチンに参照渡しでなく値渡しで与える場合、このパラメータは ByVal キーワードで指定する必要があります。(par_id3146922.13)

Example:
例:(hd_id3153951.14)

Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( long )
Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( long )(par_id3154320.15)

Sub ExampleDeclare
Sub ExampleDeclare(par_id3150417.17)

Dim lValue As Long
Dim lValue As Long(par_id3149959.18)

lValue = 5000
lValue = 5000(par_id3145647.19)

MyMessageBeep( lValue )
MyMessageBeep( lValue )(par_id3145801.20)

FreeLibrary("user32.dll" )
FreeLibrary("user32.dll" )(par_id3145253.21)

End Sub
End Sub(par_id3149402.22)


< Prev / Next >